\(\int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx\) [221]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 48 \[ \int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx=\frac {x}{\sqrt {2}}+\frac {\arctan \left (\frac {\cos (c+d x) \sin (c+d x)}{1+\sqrt {2}+\sin ^2(c+d x)}\right )}{\sqrt {2} d} \]

[Out]

1/2*x*2^(1/2)+1/2*arctan(cos(d*x+c)*sin(d*x+c)/(1+sin(d*x+c)^2+2^(1/2)))/d*2^(1/2)

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.045, Rules used = {209} \[ \int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx=\frac {\arctan \left (\frac {\sin (c+d x) \cos (c+d x)}{\sin ^2(c+d x)+\sqrt {2}+1}\right )}{\sqrt {2} d}+\frac {x}{\sqrt {2}} \]

[In]

Int[Csc[c + d*x]/(Csc[c + d*x] + Sin[c + d*x]),x]

[Out]

x/Sqrt[2] + ArcTan[(Cos[c + d*x]*Sin[c + d*x])/(1 + Sqrt[2] + Sin[c + d*x]^2)]/(Sqrt[2]*d)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{1+2 x^2} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {x}{\sqrt {2}}+\frac {\arctan \left (\frac {\cos (c+d x) \sin (c+d x)}{1+\sqrt {2}+\sin ^2(c+d x)}\right )}{\sqrt {2} d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.46 \[ \int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx=\frac {\arctan \left (\sqrt {2} \tan (c+d x)\right )}{\sqrt {2} d} \]

[In]

Integrate[Csc[c + d*x]/(Csc[c + d*x] + Sin[c + d*x]),x]

[Out]

ArcTan[Sqrt[2]*Tan[c + d*x]]/(Sqrt[2]*d)

Maple [A] (verified)

Time = 0.38 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.42

method result size
derivativedivides \(\frac {\sqrt {2}\, \arctan \left (\tan \left (d x +c \right ) \sqrt {2}\right )}{2 d}\) \(20\)
default \(\frac {\sqrt {2}\, \arctan \left (\tan \left (d x +c \right ) \sqrt {2}\right )}{2 d}\) \(20\)
risch \(\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-2 \sqrt {2}-3\right )}{4 d}-\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+2 \sqrt {2}-3\right )}{4 d}\) \(54\)

[In]

int(csc(d*x+c)/(csc(d*x+c)+sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/2/d*2^(1/2)*arctan(tan(d*x+c)*2^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.96 \[ \int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx=-\frac {\sqrt {2} \arctan \left (\frac {3 \, \sqrt {2} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {2}}{4 \, \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right )}{4 \, d} \]

[In]

integrate(csc(d*x+c)/(csc(d*x+c)+sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/4*sqrt(2)*arctan(1/4*(3*sqrt(2)*cos(d*x + c)^2 - 2*sqrt(2))/(cos(d*x + c)*sin(d*x + c)))/d

Sympy [F]

\[ \int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx=\int \frac {\csc {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + \csc {\left (c + d x \right )}}\, dx \]

[In]

integrate(csc(d*x+c)/(csc(d*x+c)+sin(d*x+c)),x)

[Out]

Integral(csc(c + d*x)/(sin(c + d*x) + csc(c + d*x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 245 vs. \(2 (44) = 88\).

Time = 0.34 (sec) , antiderivative size = 245, normalized size of antiderivative = 5.10 \[ \int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx=\frac {\sqrt {2} \arctan \left (\frac {2 \, \sqrt {2} \sin \left (d x + c\right )}{2 \, {\left (\sqrt {2} + 1\right )} \cos \left (d x + c\right ) + \cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sqrt {2} + 3}, \frac {\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) - 1}{2 \, {\left (\sqrt {2} + 1\right )} \cos \left (d x + c\right ) + \cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sqrt {2} + 3}\right ) - \sqrt {2} \arctan \left (\frac {2 \, \sqrt {2} \sin \left (d x + c\right )}{2 \, {\left (\sqrt {2} - 1\right )} \cos \left (d x + c\right ) + \cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sqrt {2} + 3}, \frac {\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right ) - 1}{2 \, {\left (\sqrt {2} - 1\right )} \cos \left (d x + c\right ) + \cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sqrt {2} + 3}\right )}{4 \, d} \]

[In]

integrate(csc(d*x+c)/(csc(d*x+c)+sin(d*x+c)),x, algorithm="maxima")

[Out]

1/4*(sqrt(2)*arctan2(2*sqrt(2)*sin(d*x + c)/(2*(sqrt(2) + 1)*cos(d*x + c) + cos(d*x + c)^2 + sin(d*x + c)^2 +
2*sqrt(2) + 3), (cos(d*x + c)^2 + sin(d*x + c)^2 + 2*cos(d*x + c) - 1)/(2*(sqrt(2) + 1)*cos(d*x + c) + cos(d*x
 + c)^2 + sin(d*x + c)^2 + 2*sqrt(2) + 3)) - sqrt(2)*arctan2(2*sqrt(2)*sin(d*x + c)/(2*(sqrt(2) - 1)*cos(d*x +
 c) + cos(d*x + c)^2 + sin(d*x + c)^2 - 2*sqrt(2) + 3), (cos(d*x + c)^2 + sin(d*x + c)^2 - 2*cos(d*x + c) - 1)
/(2*(sqrt(2) - 1)*cos(d*x + c) + cos(d*x + c)^2 + sin(d*x + c)^2 - 2*sqrt(2) + 3)))/d

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.50 \[ \int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx=\frac {\sqrt {2} {\left (d x + c + \arctan \left (-\frac {\sqrt {2} \sin \left (2 \, d x + 2 \, c\right ) - 2 \, \sin \left (2 \, d x + 2 \, c\right )}{\sqrt {2} \cos \left (2 \, d x + 2 \, c\right ) + \sqrt {2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 2}\right )\right )}}{2 \, d} \]

[In]

integrate(csc(d*x+c)/(csc(d*x+c)+sin(d*x+c)),x, algorithm="giac")

[Out]

1/2*sqrt(2)*(d*x + c + arctan(-(sqrt(2)*sin(2*d*x + 2*c) - 2*sin(2*d*x + 2*c))/(sqrt(2)*cos(2*d*x + 2*c) + sqr
t(2) - 2*cos(2*d*x + 2*c) + 2)))/d

Mupad [B] (verification not implemented)

Time = 24.87 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.17 \[ \int \frac {\csc (c+d x)}{\csc (c+d x)+\sin (c+d x)} \, dx=\frac {\sqrt {2}\,\left (\mathrm {atan}\left (\frac {\sqrt {2}\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{4}+\frac {7\,\sqrt {2}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}\right )+\mathrm {atan}\left (\frac {\sqrt {2}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}\right )\right )}{2\,d} \]

[In]

int(1/(sin(c + d*x)*(sin(c + d*x) + 1/sin(c + d*x))),x)

[Out]

(2^(1/2)*(atan((7*2^(1/2)*tan(c/2 + (d*x)/2))/4 + (2^(1/2)*tan(c/2 + (d*x)/2)^3)/4) + atan((2^(1/2)*tan(c/2 +
(d*x)/2))/4)))/(2*d)